package org.lztvn.elearning.service;

import java.util.List;

import org.lztvn.elearning.dao.IProductDao;
import org.lztvn.elearning.dao.ITopicDao;
import org.lztvn.elearning.entities.Topic;
import org.springframework.transaction.annotation.Transactional;
@Transactional
public class TopicServiceImpl implements ITopicService {
	ITopicDao dao;
	
	public ITopicDao getDao() {
		return dao;
	}

	public void setDao(ITopicDao dao) {
		this.dao = dao;
	}

	@Override
	public Long addTopic(Topic t) {
		return dao.addTopic(t);
	}

	@Override
	public void deleteTopic(Long idTopics) {
		dao.deleteTopic(idTopics);
	}

	@Override
	public void modifierTopic(Topic t) {
	   dao.modifierTopic(t);
	}

	@Override
	public List<Topic> listTopic(int position, int nb_topic) {
		return dao.listTopic(position,nb_topic);
	}

	@Override
	public List<Topic> listTopicByUserId(Long idUser, int position, int nb_topic) {
		return dao.listTopicByUserId(idUser, position, nb_topic);
	}

	@Override
	public Topic getTopic(Long idTopic) {
		return dao.getTopic(idTopic);
	}

	@Override
	public Long getNbTopicByUserId(Long idTopic) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Long getNbTopic() {
		return dao.getNbTopic();
	}

}
